package com.power.using.mydaggerp.presenter.detail;

import android.support.annotation.NonNull;

import com.power.using.mydaggerp.contract.detail.WebViewLoadConaract;
import com.power.using.mydaggerp.model.detail.WebViewLoadModel;

/**
 * Created by 聪明一只哈 on 2019/10/12.
 * Time: 2019/10/12  15:29
 */
public class WebViewLoadPresenter extends WebViewLoadConaract.WebViewLoadPresenter{

    @NonNull
    public static WebViewLoadPresenter newInstance() {
        return new WebViewLoadPresenter();
    }


    @Override
    public void loadUrl(String url) {
        if(mIView==null){
            return;
        }
        try{
            mIView.showUrlDetail(url);
        }catch (Exception e){
            mIView.showNetworkError();
            e.printStackTrace();
        }

    }

    @Override
    protected WebViewLoadConaract.IWebViewLoadModel getModel() {
        return WebViewLoadModel.newInstance();
    }

    @Override
    public void onStart() {

    }
}
